<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<input type="button" value="getString" id="btn1"/>
<input type="button" value="getDate" id="btn2"/>
<input type="button" value="getUser" id="btn3"/>
<input type="button" value="getList" id="btn4"/>
<input type="button" value="getMap" id="btn5"/>
<input type="button" value="send" id="btn6"/>
<input type="button" value="sendJson" id="btn7"/>
<form action="" id="form1">
  <input type="text" name="telephone"/>
   <input type="password" name="password"/>
   <input type="submit" value="提交" id="btn8"/>
</form>
<script type="text/javascript"  src="/ssm34/js/jquery-1.12.3.min.js"></script>
<script type="text/javascript">
   
   $(function(){
	   alert({"id":1,"telephone":"1234568"});
	   alert(JSON.stringify({id:1,telephone:"1234568"}));
	   $("#btn1").click(function(){
		   
		   $.ajax({
			   url:"getString",
			   type:"get",
			   async:true,
			   error:function(){
				   
				   
			   },
			   success:function(data){
				   
				   alert(data);
				   
			   }
			   
			   
		   });
		   
		   
	   });
	   
	   
	   
 	$("#btn2").click(function(){
		   
		   $.ajax({
			   url:"getDate",
			   type:"get",
			   async:true,
			   error:function(){
				   
				   
			   },
			   success:function(data){
				   
				   alert(data);
				   
			   }
			   
			   
		   });
		   
		   
	   });
 	
 	
 	$("#btn3").click(function(){
		   
		   $.ajax({
			   url:"getUser",
			   type:"get",
			   async:true,
			   dataType:"json",
			   error:function(){
				   
				   
			   },
			   success:function(data){
				   
				   alert(data.birthday);
				   
			   }
			   
			   
		   });
		   
		   
	   });
 	
 	
	$("#btn4").click(function(){
		   
		   $.ajax({
			   url:"getList",
			   type:"get",
			   async:true,
			   //dataType:"json",
			   error:function(){
				   
				   
			   },
			   success:function(data){
				   alert(JSON.parse(data).length);
				   
				   //alert(data.length);
				   
			   }
			   
			   
		   });
		   
		   
	   });
	   
	   
	$("#btn5").click(function(){
		   
		   $.ajax({
			   url:"getMap",
			   type:"get",
			   async:true,
			   dataType:"json",
			   error:function(){
				   
				   
			   },
			   success:function(data){
				   
				   alert(data.data.length);
				   
			   }
			   
			   
		   });
		   
		   
	   });
	
	
	$("#btn6").click(function(){
		   alert("yes")
		   $.ajax({
			   url:"getRequest",
			   type:"post",
			   async:true,
			   data:{id:1,telephone:"1234568"},
			   error:function(){
				   
				   
			   },
			   success:function(data){
				   
				   alert(data);
				   
			   }
			   
			   
		   });
		   
		   
	   });
	
	
	
	$("#btn7").click(function(){
		   alert("hahah")
		   $.ajax({
			   url:"getRequest1",
			   type:"post",
			   async:true,
			   contentType:"application/json",
			   data:"{\"id\":1,\"telephone\":\"1234567\"}",
			   error:function(){
				   
				   
			   },
			   success:function(data){
				   
				   alert(data);
				   
			   }
			   
			   
		   });
		   
		   
	   });
	
	
	$("#btn8").click(function(){
		   
		   $.ajax({
			   url:"getRequest2",
			   type:"post",
			   async:true,
			 
			   //data:{"telephone":$(":text[name=telephone]").val(),"password":$(":password[name=password]").val()},
			  data:$("#form1").serialize(),
			   error:function(){
				   
				   
			   },
			   success:function(data){
				   
				   alert(data);
				   
			   }
			   
			   
		   });
		   
		   
		   return false;
	   });
   })
   
</script>

</body>
</html>